<?php

namespace app\checkin;

use think\admin\Plugin;

/**
 * 打卡积分应用服务
 */
class Service extends Plugin
{
    /**
     * 定义插件名称
     * @var string
     */
    protected $appName = '打卡积分';

    /**
     * 定义应用菜单
     */
    public static function menu(): array
    {
        $code = app(static::class)->appCode;

        return [
            [
                'name' => '打卡积分',
                'subs' => [
                    [
                        'name' => '门店管理',
                        'subs' => [
                            ['name' => '门店信息管理', 'icon' => 'layui-icon layui-icon-home', 'node' => "{$code}/store/index"],
                        ],
                    ],
                    [
                        'name' => '会员管理',
                        'subs' => [
                            ['name' => '会员列表', 'icon' => 'layui-icon layui-icon-user', 'node' => "{$code}/member/index"],
                        ],
                    ],
                    [
                        'name' => '打卡管理',
                        'subs' => [
                            ['name' => '打卡记录', 'icon' => 'layui-icon layui-icon-time', 'node' => "{$code}/record/index"],
                            ['name' => '进行中的打卡', 'icon' => 'layui-icon layui-icon-loading', 'node' => "{$code}/record/ongoing"],
                        ],
                    ],
                    [
                        'name' => '积分管理',
                        'subs' => [
                            ['name' => '积分明细', 'icon' => 'layui-icon layui-icon-list', 'node' => "{$code}/points/index"],
                        ],
                    ],
                    [
                        'name' => '礼品管理',
                        'subs' => [
                            ['name' => '礼品列表', 'icon' => 'layui-icon layui-icon-gift', 'node' => "{$code}/gift/index"],
                        ],
                    ],
                    [
                        'name' => '兑换管理',
                        'subs' => [
                            ['name' => '兑换记录', 'icon' => 'layui-icon layui-icon-transfer', 'node' => "{$code}/exchange/index"],
                        ],
                    ],
                    [
                        'name' => '系统设置',
                        'subs' => [
                            ['name' => '规则设置', 'icon' => 'layui-icon layui-icon-set', 'node' => "{$code}/setting/index"],
                        ],
                    ],
                ],
            ],
        ];
    }
}

